import request from '@/utils/request';
import { TableListItem } from './data.d';

export async function queryList(params?: any): Promise<any> {
  return request({
    url: '/api/app/mgt/info/detail/query',
    method: 'POST',
    data: params,
  });
}

export async function createData(params: Omit<TableListItem, 'id'>): Promise<any> {
  return request({
    url: '/api/app/mgt/info/add',
    method: 'POST',
    data: params,
  });
}

export async function updateData(params: Omit<TableListItem, 'id'>): Promise<any> {
  return request({
    url: `/api/app/mgt/info/update`,
    method: 'POST',
    data: params,
  });
}

export async function removeData(params): Promise<any> {
  return request({
    url: `/api/app/mgt/info/delete`, 
    method: 'POST',
    data: params,
  });
}

export async function switchData(params): Promise<any> {
  return request({
    url: `/api/app/mgt/status/switch`, 
    method: 'POST',
    data: params,
  });
}

export async function detailData(params): Promise<any> {
  return request({
    url: '/api/app/mgt/info/get',
    method: 'POST',
    params: params,
  });
}
